#pragma once

#include "iftpagent.h"
#include "IFTPClient.h"
#include "Ftp.h"

class CDllFTP :
	public IFTPAgent,
	public IFTPClientNotify
{

public:

	CDllFTP(void);
	virtual ~CDllFTP(void);

public:

	virtual bool MakeDirectory(TCHAR strDirectory[MAX_PATH]);
	virtual bool IsFileExist(TCHAR strFilePath[MAX_PATH]);
	virtual bool UploadFile(TCHAR szLocalFile[MAX_PATH], TCHAR szRemoteFile[MAX_PATH]);
	virtual bool DownloadFile(TCHAR szRemoteFile[MAX_PATH], TCHAR szLocalFile[MAX_PATH],int iTimeOut = 0);
	virtual bool Login(TCHAR* pHost, TCHAR* pUser, TCHAR* pPwd, UINT32 nPort);
	virtual bool Logout();
	virtual	bool Rename(TCHAR szCurrentFileName[MAX_PATH], TCHAR szNewFileName[MAX_PATH]);
	virtual bool Remove(TCHAR szFileName[MAX_PATH]);

public:

	bool NotifyFtpStatus(DWORD dwStatus, DWORD dwParam1 = 0, DWORD dwParam2 = 0);
	
protected:

	HMODULE					m_hModule;
	LPGetFTPClient			m_pGetFTPClient;
	LPReleaseFTPClient		m_pReleaseFTPClient;
	IFTPClient*				m_pIFTPClient;
};

